package com.example.demo.proxy;

public class ProxySubject implements Subject{
    private Subject realSubject;

    public ProxySubject(Subject subject){
        this.realSubject = subject;
    }

    @Override
    public void request() {
        System.out.println("ProxySubject request");
        realSubject.request();
    }

    public static void main(String[] args) {
        Subject subject = new RealSubject();
        Subject proxySubject = new ProxySubject(subject);
        proxySubject.request();
    }
}
